<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript" src="<s:url value="/js/irb.js"/>"></script>

<div id="filter">
    <s:form action="list" cssClass="tableFilter">
        <tr>
            <th colspan="4" class="tableTitle">
                <h5>Search</h5>
            </th>
        </tr>
        <tr>
            <s:doubleselect
                    id="country"
                    label="Country"
                    list="paisComites.keySet()"
                    value="%{countryIrb}"
                    name="countryIrb"
                    doubleId="comite"
                    doubleHeaderKey="" doubleHeaderValue="Choose Committee"
                    doubleListKey="id"
                    doubleListValue="name"
                    doubleName="irb.comiteEtica.id"
                    doubleValue="%{irb.comiteEtica.id}"
                    doubleList="paisComites.get(top)"
                    />
        </tr>
        <tr>
            <td colspan="4" class="centeredButtons"><s:submit value="Search" name="filter" theme="simple" />
                <s:submit action="create" value="New" theme="simple" onclick="resetForms();"/></td>
        </tr>

    </s:form>
</div>

<s:if test="!list.isEmpty()">
    <div id="table_content">
        <table class="paginated-table">
            <thead>
            <tr>
                <th>Committee</th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            <s:iterator value="list" var="sop">
            <tr>
                <th><s:property value="%{#sop.comiteEtica.name}"/></th>
                <th>
                    <s:form action="create">
                        <s:hidden value="%{#sop.id}" name="editableIrbId"/>
                        <img src="<s:url value="/images/edit.png"/>" onclick="$(this).closest('form').submit()" alt="Edit"/>
                    </s:form>
                </th>
            </tr>
            </s:iterator>
            <tbody>
        </table>
        <div style="width: 100%;text-align: center" >
            <span class="prev" style="" >Previous</span><span class="next">Next</span>
        </div>

        <script type="text/javascript">
            paginar(10);
        </script>
    </div>
</s:if>

<script type="text/javascript">
    $('#irb').css({"color":"#EE5102","fontWeight":"bold"});
</script>